<template>
  <div class="feedback-card">
    <div class="emoji-circle">
      <!-- 展示传入的圆形图片 -->
      <img
        :src="avatarUrl"
        class="emoji"
        :alt="`${line1} ${line2}`"  <!-- 添加alt属性提高可访问性 -->
      >
    </div>
    <div class="stars">
      <span>★</span><span>★</span><span>★</span><span>★</span><span>★</span>
    </div>
    <p class="text">
      {{ line1 }}<br />
      {{ line2 }}
    </p>
  </div>
</template>

<script>
  export default {
    props: {
      avatarUrl: {
        type: String,
        required: true
      },
      line1: {
        type: String,
        required: true
      },
      line2: {
        type: String,
        required: true
      }
    }
  }
</script>

<style scoped>
  .feedback-card {
    width: 280px;
    background-color: #b9f6ca;
    border-radius: 20px;
    text-align: center;
    padding: 20px;
    font-family: Arial, sans-serif;
  }

  .emoji-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ffa726;
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 添加内边距避免图片贴边 */
    padding: 5px;
  }

  .emoji {
    /* 核心：圆形图片 */
    border-radius: 50%; /* 圆形裁剪 */
    width: 100%; /* 填满父容器宽度 */
    height: 100%; /* 填满父容器高度 */
    object-fit: cover; /* 保持比例并填充容器（裁剪边缘） */
    /* 可选：添加边框增强圆形效果 */
    border: 2px solid white;
  }

  .stars {
    color: #ffeb3b;
    font-size: 20px;
    margin-bottom: 15px;
  }

  .text {
    font-size: 18px;
    color: #000;
    line-height: 1.4;
    margin: 0;
  }
</style>

